package com.bdq.common.feign.content;

import com.bdq.common.entity.common.CommonResult;
import com.bdq.common.entity.common.PageResult;
import com.bdq.common.feign.content.param.ContentQueryParam;
import com.bdq.common.feign.content.param.ContentSearchParam;
import com.bdq.common.feign.content.param.UserPostPageParam;
import com.bdq.common.feign.content.vo.ContentListVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author malei
 * @date 2024-05-26 11:07
 */
@FeignClient(name = "bdq-content")
public interface ContentFeign {

    /**
     * 前缀
     */
    String PREFIX = "content";

    /**
     * 列表查询内容
     *
     *
     * @param userId
     * @param contentIds
     * @return
     */
    @GetMapping(PREFIX + "/list")
    CommonResult<List<ContentListVO>> listContent(@RequestParam(name = "userId") Long userId, @RequestParam(name = "contentIds") List<Long> contentIds);

    /**
     * 内容搜索
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/search")
    CommonResult<PageResult<Long>> contentSearch(@RequestBody ContentSearchParam param);

    /**
     * 内容查询
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/query")
    CommonResult<PageResult<Long>> contentQuery(@RequestBody ContentQueryParam param);

    /**
     * 用户发布内容查询
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/user/post/page")
    CommonResult<PageResult<Long>> pageUserPost(@RequestBody UserPostPageParam param);
}
